home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload Trio 2 / Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO / dir39 / arconv01.zip / INSTALL.BTM < prev    next >
Text File  |  1993-06-28  |  4KB  |  123 lines

  1. @echo off
  2. loadbtm on
  3. setlocal
  4.  
  5. :: Install.btm, ver 1.0, June 21 1993, By E.T.C
  6. :: This script interactively installs the scripts for my archive utils.
  7. :: It requires the following files: a?.dat; da?.dat; compstat.awk; to?.dat
  8.  
  9. echo.
  10. echo.
  11. echo This script creates and installs the archive managament files in your harddisk.
  12. inkey /k"ynYN"  would you like to proceed with installation (y/n)? %%YN
  13. if "%YN" == "n" goto finish
  14. if "%YN" == "N" goto finish
  15. echo You'll be able to abort by anytime by pressing enter only for any question.
  16.  
  17. :getbtmpath
  18. echo.
  19. echo Choose a directory to place the .BTM script files. A good choice is a-
  20. echo directory which is included in your PATH. Enter the FULL path without the-
  21. echo trailing backslash (e.g C:\BAT), or just enter to abort.
  22. input %%BTMPATH
  23. if "%BTMPATH" == "" goto finish
  24. if isdir %BTMPATH goto contbtm
  25. beep
  26. echo.
  27. echo %BTMPATH is not a valid path name! Please retry.
  28. goto getbtmpath
  29.  
  30. :contbtm
  31. iff "%@SUBSTR[%BTMPATH, 0, -1]" == "\" then
  32.   beep
  33.   echo Path must not end with backslash (\). Please retry
  34.   goto getbtmpath
  35. endiff
  36.  
  37. :getarcpath
  38. echo.
  39. echo Please type the directory where your archivers are placed. Enter the FULL-
  40. echo path without the backslash (e.g C:\UTILITY\ZIP), or just enter to abort.
  41. input %%ARCPATH
  42. if "%ARCPATH" == "" goto finish
  43. if isdir %ARCPATH goto contarc
  44. beep
  45. echo.
  46. echo %ARCPATH is not a valid path name! Please retry.
  47. goto getarcpath
  48.  
  49. :contarc
  50. iff "%@SUBSTR[%ARCPATH, 0, -1]" == "\" then
  51.   beep
  52.   echo Path must not end with backslash (\). Please retry.
  53.   goto getarcpath
  54. endiff
  55.  
  56. :getlogpath
  57. unset /q LOGPATH
  58. echo.
  59. echo The archive converter has an option to keep logging of its results, on
  60. echo which some statistics can be calculated using compstat.btm in this package.
  61. inkey /k"yYnNaA" Would you like to enable the logging (Yes/No/Abort)? %%YN
  62. if "%yn" == "a" goto finish
  63. if "%yn" == "A" goto finish
  64. if "%yn" == "n" goto install
  65. if "%yn" == "N" goto install
  66. echo.
  67. echo Please choose a filename for the log file. Enter the FULL path of the file-
  68. echo (e.g C:\UTILITY\ZIP\STATS.DAT), or just enter to abort.
  69. input %%LOGPATH
  70. if "%LOGPATH" == "" goto finish
  71. if not exist %LOGPATH goto contlog
  72. beep
  73. echo.
  74. echo %LOGPATH Already exists! Please retry.
  75. goto getlogpath
  76.  
  77. :contlog
  78. echo Please enter the path of an AWK compatible program. Enter the FULL path-
  79. echo no need for extension (e.g C:\UTILITY\GAWK), or just enter to abort.
  80. input %%AWKPATH
  81. if "%AWKPATH" == "" goto finish
  82. set LOGPATH=%@FULL[%LOGPATH]
  83. set AWKPATH=%@FULL[%AWKPATH]
  84. echo Original_archive  Original_size  New_archive  New_size > %LOGPATH
  85.  
  86. :install
  87. echo Installing files - please wait...
  88. copy /q a1.dat %BTMPATH\a.btm
  89. echo set BASEDIR=%ARCPATH >> %BTMPATH\a.btm
  90. copy /q %BTMPATH\a.btm + a2.dat %BTMPATH\a.btm
  91. copy /q da1.dat %BTMPATH\da.btm
  92. echo set BASEDIR=%ARCPATH >> %BTMPATH\da.btm
  93. copy /q %BTMPATH\da.btm + da2.dat %BTMPATH\da.btm
  94. copy /q to1.dat %BTMPATH\to.btm
  95. echo call %BTMPATH\da.btm ..\%%RUN >> %BTMPATH\to.btm
  96. echo if errorlevel 1 goto error >> %BTMPATH\to.btm
  97. echo call %BTMPATH\a.btm %%ARC -r %%FILENAME >> %BTMPATH\to.btm
  98. copy /q %BTMPATH\to.btm + to2.dat %BTMPATH\to.btm
  99.  
  100.  
  101. iff "%LOGPATH" == "" then
  102.   copy /q %BTMPATH\to.btm + to3.dat %BTMPATH\to.btm
  103. else
  104.   echo echo %%@LOWER[%%@EXT[..\%%RUN]] %%OLD %%@LOWER[%%ARC] %%NEW >> %LOGPATH >> %BTMPATH\to.btm
  105.   copy /q %BTMPATH\to.btm + to3.dat %BTMPATH\to.btm
  106.   echo echo Calculating... Please wait > %BTMPATH\compstat.btm
  107.   echo %AWKPATH -f %BTMPATH\compstat.awk %LOGPATH >> %BTMPATH\compstat.btm
  108.   copy /q compstat.awk %BTMPATH
  109. endiff
  110.  
  111. echo.
  112. echo.
  113. echo Installation completed, Commands ready to use.
  114. echo Note that the commands a.btm & da.btm have various archivers with the-
  115. echo switches I believe are most comfortable. However, if you wish to add/delete-
  116. echo an archiver from the list, or modify any of their options, you can do it
  117. echo easily with an editor. They're both easy to understand and modify.
  118.  
  119. :finish
  120. endlocal
  121. quit
  122.  
  123.